<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="UserEditDlg" widgetVar="UserEditDialog" modal="true" resizable="false" appendTo="@(body)" header="#{message.EditUserTitle}">
            <h:form id="UserEditForm">
                <h:panelGroup id="display">
                    <p:panelGrid columns="2" rendered="#{userController.selected != null}">
                        <p:outputLabel value="#{message.EditUserLabel_userID}" for="userID" />
                        <p:inputText id="userID" value="#{userController.selected.userID}" title="#{message.EditUserTitle_userID}" required="true" requiredMessage="#{message.EditUserRequiredMessage_userID}"/>
                        <p:outputLabel value="#{message.EditUserLabel_groupname}" for="groupname" />
                        <p:inputText id="groupname" value="#{userController.selected.groupname}" title="#{message.EditUserTitle_groupname}" />
                        <p:outputLabel value="#{message.EditUserLabel_userCalendarPrivacy}" for="userCalendarPrivacy" />
                        <p:selectBooleanCheckbox id="userCalendarPrivacy" value="#{userController.selected.userCalendarPrivacy}" />
                        <p:outputLabel value="#{message.EditUserLabel_userEmail}" for="userEmail" />
                        <p:inputText id="userEmail" value="#{userController.selected.userEmail}" title="#{message.EditUserTitle_userEmail}" />
                        <p:outputLabel value="#{message.EditUserLabel_userLastName}" for="userLastName" />
                        <p:inputText id="userLastName" value="#{userController.selected.userLastName}" title="#{message.EditUserTitle_userLastName}" />
                        <p:outputLabel value="#{message.EditUserLabel_userName}" for="userName" />
                        <p:inputText id="userName" value="#{userController.selected.userName}" title="#{message.EditUserTitle_userName}" />
                        <p:outputLabel value="#{message.EditUserLabel_userPassword}" for="userPassword" />
                        <p:inputText id="userPassword" value="#{userController.selected.userPassword}" title="#{message.EditUserTitle_userPassword}" />
                        <p:outputLabel value="#{message.EditUserLabel_userUsername}" for="userUsername" />
                        <p:inputText id="userUsername" value="#{userController.selected.userUsername}" title="#{message.EditUserTitle_userUsername}" />
                        <p:outputLabel value="#{message.EditUserLabel_userAddress}" for="userAddress" />
                        <p:selectOneMenu id="userAddress" value="#{userController.selected.userAddress}" >
                            <f:selectItem itemLabel="#{message.SelectOneMessage}"/>
                            <f:selectItems value="#{addressController.itemsAvailableSelectOne}"
                                           var="userAddressItem"
                                           itemValue="#{userAddressItem}"/>
                        </p:selectOneMenu>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{userController.update}" value="#{message.Save}" update="display,:UserListForm:datalist,:growl" oncomplete="handleSubmit(args, 'UserEditDialog');"/>
                    <p:commandButton value="#{message.Cancel}" onclick="UserEditDialog.hide()"/>
                </h:panelGroup>
            </h:form>
        </p:dialog>

    </ui:composition>
</html>
